import request from '@/utils/request'


//获取用户菜单接口
export function getUserMenu() {
  return request({
    url: '/admin/user/getUserMenu',
    method: 'get',
  })
}

//获取下拉菜单树 /admin/menu/getMenuTree
export function getMenuTree() {
  return request({
    url: '/admin/menu/getMenuTree',
    method: 'get',
  })
}

//获取菜单列表 /admin/menu/list
export function getMenuList(queryParams){
  return request({
    url: '/admin/menu/list',
    method: 'get',
    params:queryParams
  })
}

//获取菜单选项树 /admin/menu/getMenuOptions
export function getMenuOptionTree() {
  return request({
    url: '/admin/menu/getMenuOptions',
    method: 'get',
  })
}

//添加菜单 /admin/menu/add
export function addMenu(menu) {
  return request({
    url: '/admin/menu/add',
    method: 'post',
    data:menu
  })
}

//删除菜单 /admin/menu/delete/{menuId}
export function deleteMenu(id) {
  return request({
    url: '/admin/menu/delete/'+id,
    method: 'delete',
  })
}

//编辑菜单 /admin/menu/edit
export function editMenu(menuId) {
  return request({
    url: '/admin/menu/edit/'+ menuId,
    method: 'get',
  })
}

//编辑菜单
export function updateMenu(menu) {
  return request({
    url:'/admin/menu/update',
    method:'put',
    data:menu
  })
}